// source --> http://www.aphrodita.gr/wp-content/plugins/chaty/js/cht-front-script.min.js function launch_chaty(t){(void 0==t||"widget_index"==t)&&(t=1),jQuery("#chaty-widget-0").length&&jQuery("#chaty-widget-0 .chaty-cta-button .open-chaty").trigger("click")}function close_chaty(){jQuery(".chaty.active .chaty-open").length&&jQuery(".chaty.active .chaty-open").each(function(){jQuery(this).find(".chaty-cta-close").trigger("click")})}!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):"undefined"!=typeof module&&module.exports?module.exports=t(require("jquery")):t(jQuery)}(function(t,e){function a(a){if(t("#chaty-widget-"+a).data("animation")!=e&&"none"!=t("#chaty-widget-"+a).data("animation")){var n="chaty-animation-"+t("#chaty-widget-"+a).data("animation");t("#chaty-widget-"+a+" ."+n).removeClass(n)}}function n(){var e=!1;Y.length&&t.each(Y,function(t,a){P(a.triggers.has_countries)&&!_(a.triggers.countries)&&a.triggers.countries.length&&(e=!0)}),e?(Z=q(),""!=Z?i():c()):i()}function c(){var e="https://www.cloudflare.com/cdn-cgi/trace";t.get(e,function(t){var e=t.match("loc=(.*)");e.length>1&&(e=e[1],e&&(e=e.toUpperCase(),""==e&&(e="-"),L(e),i()))})}function i(){Y.length&&(t.each(Y,function(e,a){var n="",c="",i=0,r={},d=W(a);if(d=d&&N(a),d=d&&D(a),t.each(a.channels,function(t,e){var a=s(e);a&&(i++,r=e)}),d&&i>0&&!t("#chaty-widget-"+a.id).length){var g=C(a.settings);g="right"==g?"right":"left";var y=k(a),p="";t("body").append(p),P(a.triggers.auto_hide_widget)&&parseInt(a.triggers.hide_after)>0&&(t("#chaty-widget-"+a.id).addClass("auto-hide-chaty"),t("#chaty-widget-"+a.id).attr("data-time",a.triggers.hide_after));var u=Q(a.id,"c-widget");if(t("#chaty-widget-"+a.id).addClass(a.settings.show_cta),1==i){"vertical"!=a.settings.icon_view&&(y="right"!=g?"right":"left");var f=l(r,a.id,y);t("#chaty-widget-"+a.id+" .chaty-i-trigger").html(f),t("#chaty-widget-"+a.id+" .chaty-i-trigger").addClass("single-channel"),t("#chaty-widget-"+a.id+" .chaty-i-trigger .chaty-channel").addClass("single"),t("#chaty-widget-"+a.id+" .chaty-widget").addClass("has-single");var m=a.settings.cta_text;"first_click"==a.settings.show_cta&&(u?(t("#chaty-widget-"+a.id+" .chaty-tooltip").removeClass("chaty-tooltip"),t("#chaty-widget-"+a.id+" .chaty-i-trigger .chaty-channel").addClass("active").addClass("chaty-tooltip").addClass("pos-"+y),t("#chaty-widget-"+a.id+" .chaty-i-trigger .chaty-channel").append(""+m+"").addClass("active").addClass("has-on-hover"),t("#chaty-widget-"+a.id+" .chaty-i-trigger .chaty-channel a").append(""+m+"").addClass("has-on-hover")):t("#chaty-widget-"+a.id+" .chaty-i-trigger .chaty-channel a").append(""+m+"").removeClass("active").addClass("has-on-hover")),"all_time"==a.settings.show_cta&&t("#chaty-widget-"+a.id+" .chaty-i-trigger .chaty-tooltip").append(""+m+"").addClass("active").addClass("has-on-hover");var v=r;("Instagram"!=v.channel_type||"#ffffff"!=v.icon_color&&"#fff"!=v.icon_color)&&(n+="#chaty-widget-"+a.id+" ."+v.channel_type+"-channel .color-element{ fill: "+v.icon_color+"; color: "+v.icon_color+";}",n+="#chaty-widget-"+a.id+" .channel-icon-"+v.channel_type+" .color-element{ fill: "+v.icon_color+"; color: "+v.icon_color+";}"),n+="#chaty-widget-"+a.id+" ."+v.channel_type+"-channel .chaty-custom-icon { background-color: "+v.icon_color+"; }",n+="#chaty-widget-"+a.id+" ."+v.channel_type+"-channel .chaty-svg { background-color: "+v.icon_color+";}",n+="#chaty-widget-"+a.id+" .channel-icon-"+v.channel_type+" .chaty-svg { background-color: "+v.icon_color+";}","Contact_Us"==v.channel_type&&(n+=".chaty-contact-form-box #chaty-submit-button-"+a.id+" {background-color: "+v.contact_form_settings.button_bg_color+"; color: "+v.contact_form_settings.button_text_color+";} ")}else{t.each(a.channels,function(e,c){var i=s(c);if(i){x(c.channel_type)&&(c.channel_type=c.channel);var o=l(c,a.id,y);t("#chaty-widget-"+a.id+" .chaty-channel-list").append(o),("Instagram"!=c.channel_type||"#ffffff"!=c.icon_color&&"#fff"!=c.icon_color)&&(n+="#chaty-widget-"+a.id+" ."+c.channel_type+"-channel .color-element{ fill: "+c.icon_color+"; color: "+c.icon_color+";}",n+="#chaty-widget-"+a.id+" .channel-icon-"+c.channel_type+" .color-element{ fill: "+c.icon_color+"; color: "+c.icon_color+";}"),n+="#chaty-widget-"+a.id+" ."+c.channel_type+"-channel .chaty-custom-icon { background-color: "+c.icon_color+"; }",n+="#chaty-widget-"+a.id+" ."+c.channel_type+"-channel .chaty-svg { background-color: "+c.icon_color+";}",n+="#chaty-widget-"+a.id+" .channel-icon-"+c.channel_type+" .chaty-svg { background-color: "+c.icon_color+";}","Contact_Us"==c.channel_type&&(n+=".chaty-contact-form-box #chaty-submit-button-"+a.id+" {background-color: "+c.contact_form_settings.button_bg_color+"; color: "+c.contact_form_settings.button_text_color+";} ")}});var w=F(a.settings,a.id),m=a.settings.cta_text;"first_click"==a.settings.show_cta&&(u||(m=""));var b=y;"horizontal"==a.settings.icon_view&&(b="left"==g?"right":"left");var I='
'+m+'
';t("#chaty-widget-"+a.id+" .chaty-i-trigger").html(I);var j='
';t("#chaty-widget-"+a.id+" .chaty-i-trigger").append(j)}var u=Q(a.id,"c-widget");!u||"open"==a.settings.default_state&&1!=i||(U(a.settings,a.id),A(a.settings,a.id));var M=0;"open"!=a.settings.default_state||P(a.settings.show_close_button)||(t("#chaty-widget-"+a.id+" .chaty-widget").addClass("chaty-no-close-button").addClass("chaty-open"),M=1),P(a.settings.is_google_analytics_enabled)&&(t("#chaty-widget-"+a.id+" .chaty-channel-list .chaty-channel").addClass("has-gae"),t("#chaty-widget-"+a.id+" .chaty-i-trigger.single-channel .chaty-channel").addClass("has-gae"),t(".chaty-outer-forms.chaty-whatsapp-form.chaty-form-"+a.id+" form.add-analytics").addClass("form-google-analytics")),P(a.settings.has_custom_css)&&!_(a.settings.custom_css)&&(c+=a.settings.custom_css),"hover"==a.settings.default_state?t("#chaty-widget-"+a.id).addClass("open-on-hover"):"open"==a.settings.default_state&&(t("#chaty-widget-"+a.id+" .chaty-widget").addClass("default-open"),(u||!P(a.settings.show_close_button))&&t("#chaty-widget-"+a.id+" .chaty-widget").addClass("chaty-open"));var T=h(a.settings.widget_size,a.settings.custom_widget_size);if(T=parseInt(T),n+="#chaty-widget-"+a.id+" .chaty-channel {width: "+T+"px; height: "+T+"px; }",n+="#chaty-widget-"+a.id+" .chaty-channel > a {width: "+T+"px; height: "+T+"px; }",n+="#chaty-widget-"+a.id+" .chaty-channel > a .chaty-custom-icon {display:block; width: "+T+"px; height: "+T+"px; line-height: "+T+"px; font-size: "+parseInt(T/2)+"px; }",n+="#chaty-widget-"+a.id+" .chaty-channel button {width: "+T+"px; height: "+T+"px; margin: 0; padding:0; outline: none; border-radius: 50%;}",n+="#chaty-widget-"+a.id+" .chaty-channel .chaty-svg {width: "+T+"px; height: "+T+"px; }",n+="#chaty-widget-"+a.id+" .chaty-channel .chaty-svg img {width: "+T+"px; height: "+T+"px; }",n+="#chaty-widget-"+a.id+" .chaty-channel span.chaty-icon {width: "+T+"px; height: "+T+"px; }",n+="#chaty-widget-"+a.id+" .chaty-channel a {width: "+T+"px; height: "+T+"px; }",n+="#chaty-widget-"+a.id+" .chaty-channel .chaty-svg .chaty-custom-channel-icon {width: "+T+"px; height: "+T+"px; line-height: "+T+"px; display: block; font-size:"+parseInt(T/2)+"px; }",n+="#chaty-widget-"+a.id+" .chaty-i-trigger .chaty-cta-button {background-color: "+a.settings.widget_color+"; }",n+="#chaty-widget-"+a.id+" .chaty-i-trigger .chaty-cta-button button {background-color: "+a.settings.widget_color+"; }",n+="#chaty-widget-"+a.id+" .chaty-i-trigger .ch-pending-msg {background-color: "+a.settings.pending_mesg_count_bgcolor+"; color: "+a.settings.pending_mesg_count_color+"; }","vertical"==a.settings.icon_view){n+="#chaty-widget-"+a.id+" .chaty-channel-list {height: "+i*(T+8)+"px; }",n+="#chaty-widget-"+a.id+" .chaty-channel-list {width: "+(T+8)+"px; }";for(var z=0;i>=z;z++)n+="#chaty-widget-"+a.id+" .chaty-open .chaty-channel-list .chaty-channel:nth-child("+(z+1)+") {-webkit-transform: translateY(-"+(T+8)*(i-z-M)+"px); transform: translateY(-"+(T+8)*(i-z-M)+"px);}"}else{t("#chaty-widget-"+a.id+" .chaty-widget").addClass("hor-mode"),n+="#chaty-widget-"+a.id+" .chaty-channel-list {width: "+i*(T+8)+"px; }",n+="#chaty-widget-"+a.id+" .chaty-channel-list {height: "+T+"px; }";for(var z=0;i>=z;z++)n+="#chaty-widget-"+a.id+" .chaty-widget.left-position.hor-mode.chaty-open .chaty-channel-list .chaty-channel:nth-child("+(z+1)+") {-webkit-transform: translateX("+(T+8)*(i-z-M)+"px); transform: translateX("+(T+8)*(i-z-M)+"px);}",n+="#chaty-widget-"+a.id+" .chaty-widget.right-position.hor-mode.chaty-open .chaty-channel-list .chaty-channel:nth-child("+(z+1)+") {-webkit-transform: translateX(-"+(T+8)*(i-z-M)+"px); transform: translateX(-"+(T+8)*(i-z-M)+"px);}"}var B=a.settings.bottom_spacing,E=a.settings.side_spacing;n+="#chaty-widget-"+a.id+" .chaty-widget {bottom: "+B+"px}","left"==g?(n+="#chaty-widget-"+a.id+" .chaty-widget {left: "+E+"px; right: auto;}",n+=".chaty-outer-forms.pos-left.chaty-form-"+a.id+" {left: "+E+"px}",t(".chaty-form-"+a.id).addClass("pos-left")):(n+="#chaty-widget-"+a.id+" .chaty-widget {right: "+E+"px; left:auto;}",t(".chaty-form-"+a.id).addClass("pos-right"),n+=".chaty-outer-forms.pos-right.chaty-form-"+a.id+" {right: "+E+"px; left:auto;}"),t(".chaty-form-"+a.id).show();var q=T+15+parseInt(B);n+=".chaty-outer-forms.active.chaty-form-"+a.id+" {-webkit-transform: translateY(-"+q+"px); transform: translateY(-"+q+"px)} ",n+="#chaty-widget-"+a.id+" .chaty-tooltip:after {background-color: "+a.settings.cta_bg_color+"; color: "+a.settings.cta_text_color+"}",n+="#chaty-widget-"+a.id+" .chaty-tooltip.pos-top:before {border-top-color: "+a.settings.cta_bg_color+"; }",n+="#chaty-widget-"+a.id+" .chaty-tooltip.pos-left:before {border-left-color: "+a.settings.cta_bg_color+"; }",n+="#chaty-widget-"+a.id+" .chaty-tooltip.pos-right:before {border-right-color: "+a.settings.cta_bg_color+";}",n+="#chaty-widget-"+a.id+" .on-hover-text {background-color: "+a.settings.cta_bg_color+"; color: "+a.settings.cta_text_color+"}",n+="#chaty-widget-"+a.id+" .chaty-tooltip.pos-top .on-hover-text:before {border-top-color: "+a.settings.cta_bg_color+"; }",n+="#chaty-widget-"+a.id+" .chaty-tooltip.pos-left .on-hover-text:before {border-left-color: "+a.settings.cta_bg_color+"; }",n+="#chaty-widget-"+a.id+" .chaty-tooltip.pos-right .on-hover-text:before {border-right-color: "+a.settings.cta_bg_color+";}";var L=Q(a.id,"v-widget");if(L&&(P(a.triggers.exit_intent)||P(a.triggers.has_time_delay)&&parseInt(a.triggers.time_delay)>0||P(a.triggers.has_display_after_page_scroll)&&parseInt(a.triggers.display_after_page_scroll)>0)?(P(a.triggers.has_time_delay)&&parseInt(a.triggers.time_delay)>0&&(et=!0,parseInt(a.triggers.time_delay)>at&&(at=a.triggers.time_delay),t("#chaty-widget-"+a.id).addClass("on-chaty-delay"),t("#chaty-widget-"+a.id).addClass("delay-time-"+parseInt(a.triggers.time_delay)),t("#chaty-widget-"+a.id).attr("data-time",parseInt(a.triggers.time_delay))),P(a.triggers.has_display_after_page_scroll)&&parseInt(a.triggers.display_after_page_scroll)>0&&(nt=!0,t("#chaty-widget-"+a.id).addClass("on-chaty-scroll"),t("#chaty-widget-"+a.id).addClass("page-scroll-"+parseInt(a.triggers.display_after_page_scroll)),t("#chaty-widget-"+a.id).attr("data-scroll",parseInt(a.triggers.display_after_page_scroll))),P(a.triggers.exit_intent)&&(ct=!0,t("#chaty-widget-"+a.id).addClass("on-chaty-exit-intent"))):(o(a.id),t("#chaty-widget-"+a.id).addClass("active")),!_(a.settings.font_family)&&"none"!=a.settings.font_family){var O=a.settings.font_family;-1!=t.inArray(O,$)?"System Stack"==O&&(O="-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"):(t("head").append(''),t("head").append('')),n+="#chaty-widget-"+a.id+", #chaty-widget-"+a.id+" .chaty-tooltip:after {font-family: "+O+"}"}}ct&&S(),""!=n&&(t("#custom-chaty-css").length||t("head").append(""),t("#custom-chaty-css").append(n)),""!=c&&(t("#custom-advance-chaty-css").length||t("head").append(""),t("#custom-advance-chaty-css").append(c)),e==Y.length-1}),t("#custom-advance-chaty-css").length||t("head").append(""),t("#custom-advance-chaty-css").append(ht)),z(),I()}function s(t){if(P(t.is_agent)){if(t.agent_data.length&&(!K&&P(t.is_agent_desktop)||K&&P(t.is_agent_mobile)))return!0}else if((!K&&P(t.is_desktop)||K&&P(t.is_mobile))&&(""!=t.value||"Contact_Us"==t.channel))return!0;return!1}function o(n){if(t("#chaty-widget-"+n+" .chaty-channel.chaty-default-open").length){var c=t("#chaty-widget-"+n+" .chaty-channel.chaty-default-open a.chaty-whatsapp-form").data("form");if(!_(c)){var i=Q(n,"c-"+t("#chaty-widget-"+n+" .chaty-channel.chaty-default-open").data("channel"));if(i&&(t("#"+c).addClass("is-active"),t("#"+c).length)){var s=t("#chaty-widget-"+n+" .chaty-channel.chaty-default-open a.chaty-whatsapp-form").html();if(a(n),t("#chaty-widget-"+n).find(".ch-pending-msg").remove(),t("#chaty-widget-"+n+" .chaty-widget").removeClass("chaty-open"),t("#chaty-widget-"+n).addClass("form-open"),t("#"+c).addClass("active"),t("#chaty-widget-"+n+" .open-chaty-channel").html(s),t("#chaty-widget-"+n).addClass("active"),t("#chaty-widget-"+n).addClass("active"),t("#chaty-widget-"+n).hasClass("auto-hide-chaty")){var o=parseInt(t("#chaty-widget-"+n).data("time"));o>0&&(o+=rt,t("#chaty-widget-"+n).addClass("hide-after-"+o))}if("on"==chaty_settings.data_analytics_settings){var h=[],r=t("#chaty-widget-"+n+" .chaty-channel.chaty-default-open").data("channel"),l=Q(n,"v-"+r);if(l&&"undefined"!=typeof r&&(H(n,"v-"+r),h.push(r)),!tt&&h.length){var d=t("#chaty-widget-"+n).data("nonce");t.ajax({url:chaty_settings.ajax_url,data:{widgetId:n,channels:h,userId:n,isMobile:K,widgetNonce:d,action:"update_chaty_channel_views"},type:"post",success:function(t){},error:function(t,e,a){monitorErrorLog(t,e,a)}})}}return}}}if(t("#chaty-widget-"+n).addClass("active"),t("#chaty-widget-"+n).hasClass("auto-hide-chaty")){var o=parseInt(t("#chaty-widget-"+n).data("time"));o>0&&(o+=rt,t("#chaty-widget-"+n).addClass("hide-after-"+o))}var g=Q(n,"v-widget");if(g){H(n,"v-widget");var r,h=(t("#chaty-widget-"+n).data("user"),[]),y=0,p=0,u=t("#chaty-widget-"+n).data("key");if(typeof Y[u]!=e){var f=G("activechatyWidgets");null!=f?(f=f.split(","),-1==t.inArray(n,f)&&(f.push(n),f=f.join(","),R("activechatyWidgets",f,1))):(f=n,R("activechatyWidgets",f,1))}if(t("#chaty-widget-"+n+" .chaty-widget").hasClass("has-single")){y=1,r=t("#chaty-widget-"+n+" .chaty-channel").data("channel");var l=Q(n,"v-"+r);l&&"undefined"!=typeof r&&(H(n,"v-"+r),h.push(r))}else t("#chaty-widget-"+n+" .chaty-widget").hasClass("chaty-open")&&(p=1,t("#chaty-widget-"+n+" .chaty-channel-list .chaty-channel").each(function(){r=t(this).data("channel");var e=Q(n,"v-"+r);e&&"undefined"!=typeof r&&(H(n,"v-"+r),h.push(r))}));if(g&&!tt){var d=t("#chaty-widget-"+n).data("nonce");tt||t.ajax({url:chaty_settings.ajax_url,data:{widgetId:n,channels:h,userId:n,isMobile:K,isOpen:p,isSingle:y,widgetNonce:d,action:"update_chaty_widget_views"},type:"post",success:function(t){},error:function(t,e,a){monitorErrorLog(t,e,a)}})}}}function h(t,e){return t}function r(t,e){switch(t){case"chat-smile":return'';case"chat-bubble":return'';case"chat-db":return'';default:return''}}function l(e,a,n){var c="";if(!P(e.is_agent)){x(e.channel_type)&&(e.channel_type=e.channel);var i=b(e,a),s=u(e,i,n,a);if("Contact_Us"==e.channel_type)c+=" has-chaty-box chaty-contact-form";else if("Whatsapp"==e.channel_type&&P(e.has_welcome_message)&&!_(e.chat_welcome_message)&&P(e.is_default_open)){var o=Q(a,"c-"+e.channel_type);o&&(c+=" chaty-default-open")}return"
"+s+"
"}if(e.agent_data.length){var h=0,r=[];if(t.each(e.agent_data,function(t,e){""!=e.value&&(h++,r=e)}),h>0){var i,s,l=v(a);return null==l&&(l=-1),d(e,a),i=b(e,a),s=u(e,i,n,a),("Instagram"!=e.channel||"#ffffff"!=e.icon_color&&"#fff"!=e.icon_color)&&(ht+=".chaty-agent-"+a+"-"+e.channel+" .color-element {fill: "+e.icon_color+"; color: "+e.icon_color+";}"),ht+=".chaty-agent-"+a+"-"+e.channel+" .chaty-custom-icon { background-color: "+e.icon_color+";}",ht+=".chaty-agent-"+a+"-"+e.channel+" .chaty-svg-img { background-color: "+e.icon_color+";}","
"+s+"
"}}}function d(e,a){var n="",c=v(a);null==c&&(c=-1),n+="",ht+=".chaty-agent-header.agent-info-"+a+"-"+e.channel+" { background-color: "+e.header_bg_color+"; color: "+e.header_text_color+" } ",ht+=".agent-info-"+a+"-"+e.channel+" .chaty-close-agent-list svg { fill: "+e.header_text_color+" } ",t("body").append(n)}function g(e,a,n,c,i,s){var o=e.value,h="_blank";if("Whatsapp"==a.channel_type){var r=y(e.value);K?(h="",o="https://wa.me/"+r):(h="_blank",o="https://web.whatsapp.com/send/?phone="+r)}else"WeChat"==a.channel_type?(h="",o="javascript:;"):"Email"==a.channel_type?(h="",o="mailto:"+e.value):"Facebook_Messenger"==a.channel_type?h=K?"":"_blank":"SMS"==a.channel_type?(h="",o="sms:"+e.value):"Telegram"==a.channel_type?(o=p(e.value,"@"),o="https://telegram.me/"+o,h="_blank"):"Twitter"==a.channel_type?o="https://twitter.com/"+t.trim(e.value):"Phone"==a.channel_type?(h="",o="tel:"+t.trim(e.value)):"Skype"==a.channel_type?(h="",o="skype:"+t.trim(e.value)+"?chat"):"Snapchat"==a.channel_type?o="https://www.snapchat.com/add/"+t.trim(e.value):"Vkontakte"==a.channel_type?o="https://vk.me/"+t.trim(e.value):"Linkedin"==a.channel_type?o="personal"==e.link_type?"https://www.linkedin.com/in/"+t.trim(e.value):"https://www.linkedin.com/company/"+t.trim(e.value):"Viber"==a.channel_type?(o=p(e.value,"+"),isNaN(o)||(o=o.replace("+",""),navigator.userAgent.match(/(iPod|iPhone|iPad)/)&&(o="+"+o),o="viber://chat?number="+o),h=""):"TikTok"==a.channel_type&&(o=p(t.trim(e.value),"@"),o="https://www.tiktok.com/@"+o,h="");return""+i+""+s+""}function y(t){return t=p(t,"+"),t=t.replace(/ /g,""),t=t.replace(/-/g,""),t=t.replace(/_/g,"")}function p(e,a){for(e=t.trim(e);e.charAt(0)==a;)e=e.substring(1);for(;e.charAt(e.length-1)==a;)e=e.substring(0,e.length-1);return e}function u(e,a,n,c){var i="";if(P(e.is_agent))e.url="javascript:;",e.target="";else if("Whatsapp"==e.channel_type)if(P(e.has_welcome_message)&&!_(e.chat_welcome_message))e.url="javascript:;",e.target="",i+=" has-chaty-box chaty-whatsapp-form",m(e,c);else{var s="";if(!_(e.pre_set_message)){s=decodeURI(e.pre_set_message);var o=t("title").text();s=_(o)?s.replace(/{title}/g,""):s.replace(/{title}/g,o),s=s.replace(/{url}/g,window.location),s=encodeURIComponent(s)}K?(e.target="",e.url="https://wa.me/"+e.value+"?text="+s):(e.target="_blank",P(e.is_use_web_version)?e.url="https://wa.me/"+e.value+"?text="+s:e.url="https://web.whatsapp.com/?phone="+e.value+"&text="+s)}else if("WeChat"==e.channel_type)_(e.qr_code_image_url)||(w(e,c),e.url="javascript:;",e.target="",i+=" has-chaty-box chaty-qr-code-form");else if("Contact_Us"==e.channel_type)f(e,c),e.url="javascript:;",e.target="",i+=" has-chaty-box chaty-contact-us-form";else if("Email"==e.channel_type){if(!_(e.mail_subject)){var h=decodeURI(e.mail_subject),o=t("title").text();h=_(o)?h.replace(/{title}/g,""):h.replace(/{title}/g,o),h=h.replace(/{url}/g,window.location),h=encodeURIComponent(h),e.url+="?subject="+h}}else"Viber"==e.channel_type?(e.value=p(e.value,"+"),K&&!isNaN(e.value)&&navigator.userAgent.match(/(iPod|iPhone|iPad)/)&&(e.value="+"+e.value),e.url="viber://chat?number="+e.value,e.target=""):"Vkontakte"==e.channel_type&&(e.url="https://vk.me/"+t.trim(e.value));var r="";return _(e.click_event)||(r='onclick="'+e.click_event+'"',e.target="",e.url="javascript:;"),""+a+""}function f(e,a){var n="",c=v(a);null==c&&(c=-1),n+="",t("body").append(n)}function m(e,a){var n="",c=v(a);null==c&&(c=-1);var i="https://web.whatsapp.com/send",s="";if(K?i="https://wa.me/"+e.value:(i=P(e.is_use_web_version)?"https://web.whatsapp.com/send":"https://wa.me/"+e.value,s="_blank"),n+="",t("body").append(n),t("#chaty-form-"+a+"-"+e.channel_type+" .chaty-whatsapp-message").html(e.chat_welcome_message),!_(e.pre_set_message)){var o=e.pre_set_message,h=t("title").text();o=_(h)?o.replace(/{title}/g,""):o.replace(/{title}/g,h),o=o.replace(/{url}/g,window.location),t("#chaty-form-"+a+"-"+e.channel_type+" .csass-whatsapp-input").val(o)}t("#chaty-form-"+a+"-"+e.channel_type).show()}function v(e){var a=null;return Y.length&&t.each(Y,function(t,n){n.id==e&&(a=t)}),a}function w(e,a){var n="",c=v(a);null==c&&(c=-1),n+="",t("body").append(n)}function _(e){return null==e||""==e||""==t.trim(e)?!0:!1}function b(t){return""!=t.custom_image_url&&"null"!=t.custom_image_url?""+t.hover_text+"":""+t.svg_icon+""}function x(e){return""==e||""==t.trim(e)||null==e||"null"==e?!0:!1}function C(t){return"custom"==t.position?t.custom_position:t.position}function k(t){if("vertical"!=t.settings.icon_view)return"top";var e=C(t.settings);return"right"==e?"left":"right"}function I(){if(t(".chaty.auto-hide-chaty").length&&(J=setInterval(function(){rt++;var e=rt;if(t(".chaty.auto-hide-chaty.hide-after-"+rt).length){var a=t(".chaty.auto-hide-chaty.hide-after-"+e).data("id");t(".chaty-form-"+a).removeClass("active"),t(".chaty.auto-hide-chaty.hide-after-"+e).removeClass("active"),t("#chaty-widget-0"+a).removeClass("auto-hide-chaty")}0==t(".chaty.auto-hide-chaty").length&&clearInterval(J)},1e3)),et&&(X=setInterval(function(){if(st++,t(".chaty.delay-time-"+st).length){var e=t(".chaty.delay-time-"+st).data("id");T(e)}},1e3)),nt){t(window).on("scroll",function(){if(nt){var e=t(document).height()-t(window).height(),a=t(window).scrollTop();if(0!=e){var n=parseInt(a/e*100);if(n>=ot){var c=ot;ot=n;for(var i=c;n>=i;i++)-1==t.inArray(i,it)&&t(".chaty.on-chaty-scroll.page-scroll-"+i).length&&t(".chaty.on-chaty-scroll.page-scroll-"+i).each(function(){var e=t(this).data("id");t(this).removeClass("on-chaty-scroll"),T(e)});ot=n}}}});window.innerWidth>document.documentElement.clientWidth}}function j(){function e(){if(ct){var t=location.hash,e=t.split("#!/"),a=e[1];if(""!==a){var n=window.location.hash;""===n&&M()}}}if(window.history&&window.history.pushState&&ct){var a=100;window.history.state&&window.history.state.page&&(a=window.history.state.page),window.history.pushState({page:a+1},""),window.history.pushState({page:a+2},""),window.onpopstate=function(){e()},window.history.onpopstate=function(){e()},window.addEventListener("popstate",function(){e()}),document.addEventListener("backbutton",function(){e()}),window.addEventListener("backbutton",function(){e()}),t(window).on("popstate",function(){e()})}}function S(){K?j():t(document).mouseleave(function(t){function e(t,e,a){t.addEventListener?(t.addEventListener(e,a,!1),M()):t.attachEvent&&t.attachEvent("on"+e,a)}e(document,"mouseout",function(t){null==t.toElement&&null==t.relatedTarget&&M()})})}function M(){ct&&t(".on-chaty-exit-intent").length&&t(".on-chaty-exit-intent").each(function(){var e=t(this).data("id");t(this).removeClass("on-chaty-exit-intent"),T(e),t("#chaty-widget-"+e+" .chaty-widget").append("
"),setTimeout(function(){t(".chaty-exit-intent").addClass("animate"),setTimeout(function(){t(".chaty-exit-intent").removeClass("animate")},2500)},500)})}function T(e){o(e),t(".chaty-widget-"+e).removeClass("on-chaty-delay"),t(".chaty-widget-"+e).removeClass("on-chaty-exit-intent"),t(".chaty-widget-"+e).removeClass("on-chaty-scroll"),t(".chaty.on-chaty-delay").length||(clearInterval(X),et=!1),t(".chaty.on-chaty-exit-intent").length||(ct=!1),t(".chaty.on-chaty-scroll").length||(nt=!1)}function z(){t(".chaty-tooltip").each(function(){""==t(this).data("hover")&&t(this).removeClass("left").removeClass("right").removeClass("top").removeClass("chaty-tooltip")})}function F(t,e){return""==t.widget_icon?t.widget_icon="chat-base":"chat-image"==t.widget_icon&&_(t.widget_icon_url)&&(t.widget_icon="chat-base"),"chat-image"==t.widget_icon?"Chaty Widget":''+r(t.widget_icon,t.widget_color)+""}function A(e,a){var n=Q(a,"c-widget");n&&"none"!=e.attention_effect&&""!=e.attention_effect&&(t("#chaty-widget-"+a).attr("data-animation",e.attention_effect),t("#chaty-widget-"+a+" .chaty-widget").hasClass("has-single")?t("#chaty-widget-"+a+" .chaty-i-trigger .chaty-channel .chaty-svg").addClass("chaty-animation-"+e.attention_effect):t("#chaty-widget-"+a+" .chaty-i-trigger .chaty-cta-main .chaty-cta-button").addClass("chaty-animation-"+e.attention_effect))}function U(e,a){var n=Q(a,"c-widget");n&&P(e.is_pending_mesg_enabled)&&parseInt(e.pending_mesg_count)>0&&(t("#chaty-widget-"+a+" .chaty-widget").hasClass("has-single")?"sheen"==e.attention_effect||"spin"==e.attention_effect||"pulse"==e.attention_effect?t("#chaty-widget-"+a+" .chaty-i-trigger .chaty-channel").append(""+e.pending_mesg_count+""):t("#chaty-widget-"+a+" .chaty-i-trigger .chaty-channel .chaty-svg").append(""+e.pending_mesg_count+""):"jump"==e.attention_effect||"waggle"==e.attention_effect||"blink"==e.attention_effect||"pulse-icon"==e.attention_effect?t("#chaty-widget-"+a+" .chaty-i-trigger .chaty-cta-main .chaty-cta-button").append(""+e.pending_mesg_count+""):t("#chaty-widget-"+a+" .chaty-i-trigger .chaty-cta-main").append(""+e.pending_mesg_count+""))}function B(t){for(t=t.toString();t.length<2;)t="0"+t;return t}function D(t){var e=!0;if(P(t.triggers.has_day_hours_scheduling_rules)&&t.triggers.day_hours_scheduling_rules.length>0){var a=t.triggers.day_hours_scheduling_rules;if(a.length>0){e=!1;var n=new Date;n=E(n,t.triggers.day_time_diff);for(var c=n.getHours(),i=n.getMinutes(),s=n.getDay(),o=0;o=0&&a[o].days<=6?a[o].days==s&&(l=1):7==a[o].days?s>=0&&4>=s&&(l=1):8==a[o].days?s>=1&&5>=s&&(l=1):9==a[o].days&&(5==s||6==s)&&(l=1),1==l&&(c>a[o].start_hours&&c=a[o].start_min&&(h=1):c>a[o].start_hours&&c==a[o].end_hours?i<=a[o].end_min&&(h=1):c==a[o].start_hours&&c==a[o].end_hours&&i>=a[o].start_min&&i<=a[o].end_min&&(h=1),1==h&&i>=a[o].start_min&&i<=a[o].end_min&&(r=1)),1==h&&1==l&&(e=1),1==e&&(o=a.length+1)}}}return e}function P(t){return"1"==t||1==t||1==t||"true"==t||"yes"==t||"on"==t?!0:!1}function E(t,e){if(isNaN(e)){var a=new Date(t.toLocaleString("en-US",{timeZone:e})),n=t.getTime()-a.getTime();return new Date(t.getTime()-n)}var c=new Date;if(c=c.toLocaleString("en-US",{timeZone:"UTC"}),c=new Date(c),-1!=e.indexOf("+")){var i=e.replace("+",""),s=parseInt(i),o=60*parseFloat(i%s);o=c.getUTCMinutes()+o,o>59&&(s+=parseInt(o/60),o%=60),c.setUTCHours(c.getUTCHours()+s,o)}else if(-1!=e.indexOf("-")){var i=e.replace("-",""),s=parseInt(i),o=60*parseFloat(i%s);o=c.getUTCMinutes()-o,0>o&&(s-=parseInt(o/60),o%=60),c.setUTCHours(c.getUTCHours()-s,-o)}var n=t.getTime()-c.getTime();return new Date(t.getTime()-n)}function N(t){if(t.triggers.has_date_scheduling_rules){var e=t.triggers.date_scheduling_rules.start_date_time,a=t.triggers.date_scheduling_rules.end_date_time,n=new Date;n=E(n,t.triggers.time_diff);var c=n.getFullYear()+"-"+B(n.getMonth()+1)+"-"+B(n.getDate())+" "+B(n.getHours())+":"+B(n.getMinutes())+":"+B(n.getSeconds());return""==a&&c>=e?!0:""==e&&a>=c?!0:""!=e&&""!=a&&c>=e&&a>=c?!0:!1}return!0}function W(e){return P(e.triggers.has_countries)&&!_(e.triggers.countries)&&e.triggers.countries.length&&(Z=q(),"-"!=Z&&-1==t.inArray(Z,e.triggers.countries))?!1:!0}function q(){return Z="","undefined"!=typeof Storage&&null!=window.sessionStorage.getItem("chaty_user_country_code")?Z=window.sessionStorage.getItem("chaty_user_country_code"):V("chaty_user_country_code")&&(Z=G("chaty_user_country_code")),Z}function L(t){"undefined"!=typeof Storage?null==window.sessionStorage.getItem("chaty_user_country_code")&&window.sessionStorage.setItem("chaty_user_country_code",t):V("chaty_user_country_code")||R("chaty_user_country_code",t,365)}function O(t,e){var a=G("chatyWidget_"+t),n=[];if(null!=a&&""!=a&&(n=JSON.parse(a)),n.length>0)for(var c=0;c0)for(var i=0;i=2?!0:!1}return!0}function R(t,e,a){var n=new Date;n.setTime(n.getTime()+24*a*60*60*1e3);var c="expires="+n.toUTCString();document.cookie=t+"="+e+"; "+c+"; path=/; SameSite=Lax"}function G(t){for(var t=t+"=",e=document.cookie.split(";"),a=0;a"+e.message+""),t(".field-name, .field-email, .field-message, .field-phone").val(""),"yes"==e.redirect_action&&("yes"==e.link_in_new_tab?window.open(e.redirect_link,"_blank"):window.location=e.redirect_link),"yes"==e.close_form_after&&setTimeout(function(){if(t(".chaty-outer-forms.active").length){var e=t(".chaty-outer-forms.active").data("widget");_(e)&&0!=e||t("#chaty-widget-"+e).length&&(t("#chaty-widget-"+e).removeClass("form-open"),t(".chaty-outer-forms.active").removeClass("active"),t("#chaty-widget-"+e).find(".chaty-widget").hasClass("chaty-no-close-button")&&t("#chaty-widget-"+e).find(".chaty-widget").addClass("chaty-open"))}},1e3*parseInt(e.close_form_after_seconds));else if(1==e.error){if(e.errors.length)for(var a=0;a"+e.errors[a].message+"")}else t(".chaty-contact-inputs").append("
"+e.message+"
")}})}else t(".has-chaty-error:first").focus();return!1}),t(document).on("click",".chaty-widget.has-single .chaty-i-trigger .chaty-channel:not(.chaty-agent-button).Phone-channel",function(){window.location=t(this).find("a").prop("href")}),t(document).on("click",".chaty-widget.has-single .chaty-i-trigger .chaty-channel:not(.chaty-agent-button).Phone-channel a",function(t){t.stopPropagation(),t.stopImmediatePropagation()})})});